//
//  Util.m
//  THiOSWeb
//
//  Created by 卢臻 on 13-9-15.
//  Copyright (c) 2013年 Dexterlirush. All rights reserved.
//

#import "Util.h"

@implementation Util

+(void) cutEndingSpace:(char*) str
{
    int i = 0;
    for (; *(str+i) != 0; i++);
    *(str+i-2) = 0;
}

+ (UIBarButtonItem *)refreshBarButtonItemWithTarget:(id)target selector:(SEL)selector
{
    UIButton *refreshButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [refreshButton setImage:[UIImage imageNamed:@"Pic1-03.png"] forState:UIControlStateNormal];
    [refreshButton setFrame:CGRectMake(0, 0, 27, 28)];
    [refreshButton addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
    return [[UIBarButtonItem alloc] initWithCustomView:refreshButton];
}


+ (UIBarButtonItem *)backBarButtonItemWithTarget:(id)target selector:(SEL)selector
{
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [backButton setImage:[UIImage imageNamed:@"Pic3-03"] forState:UIControlStateNormal];
    [backButton setFrame:CGRectMake(0, 0, 14, 20)];
    [backButton addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
    return [[UIBarButtonItem alloc] initWithCustomView:backButton];
}




@end
